<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
// | Author: your name
// +----------------------------------------------------------------------
namespace app\ai\validate;

use think\Validate;

/**
 * 模板管理验证器
 */
class TemplateValidate extends Validate
{
    /**
     * 定义验证规则
     */
    protected $rule =   [
        'name' => 'require',
        'level' => 'require',
        'status' => 'require',
        'is_mask' => 'require',
        'sort' => 'require',
        'is_hot' => 'require',
    ];

    /**
     * 定义错误信息
     */
    protected $message  =   [
        'name' => '模板名称必须填写',
        'level' => '会员专享等级必须填写',
        'status' => '上下架状态必须填写',
        'is_mask' => '支持蒙版必须填写',
        'sort' => '优先级必须填写',
        'is_hot' => '是否首页推荐必须填写',
    ];

    /**
     * 定义场景
     */
    protected $scene = [
        'save' => [
            'name',
            'level',
            'status',
            'is_mask',
            'sort',
            'is_hot',
        ],
        'update' => [
            'name',
            'level',
            'status',
            'is_mask',
            'sort',
            'is_hot',
        ],
    ];

}
